<!--
 * @Author: your name
 * @Date: 2022-04-01 09:48:18
 * @LastEditTime: 2022-04-02 10:47:31
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \算法测试\day0906\4.1.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div1{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div id ="div1"></div>
    <input type="text">
    <script>
        var div1 = document.getElementById("div1");
        div1.onwheel  =function(event){
            console.log(event);
        }
        var input = document.getElementsByTagName("input")[0];
        input.onchange = function (a) { //失去焦点时触发
           // console.log(a.keyCode);
            console.log(a);
        }
        input.onkeydown = function (params) {
            console.log(params.key);
        }
    </script>
</body>
</html>